{% extends "base.html" %}

<body>
{% block header %}
{% include "monitor-menu.html" %}
{% endblock %}

{% block content %}
<div class="wrap">
	<div class="wrap_right tree">
	{% autoescape off %}
	    {{ mtree }}
	{% endautoescape %}
	</div>
	<div class="wrap_left right">
    	<div class="shenqing1">
        	<h5 style="float:left;width:96%;margin-bottom:10px;">监控列表</h5>
        <form action="/monitor/search/" method="post">
	        <input type="text" name="key" class="word_in"/>
	   	    <input type="submit" value="搜索" class="btn_search"/>
   	    </form>
   	    <a href="/monitor/add/" class="new_zeng" >新增监控</a>
		</div>
		<div class="biaoge">
		<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="table2 iebug">
		    <tr>
		        <th width="15%"><span class="first">URL</span></th>
		        <th width="15%">监控名</th>
		        <th width="6%">状态</th>
		        <th width="10%">监控类型</th>
		        <th width="10%">监控频率</th>
		        <th width="12%">报警组</th>
		        <th width="12%">策略组</th>
		        <th width="8%">可用率</th>
		        <th width="12%">操作</th>
	        </tr>
    		{% for m in monitor %}
			<tr class="{% cycle 'g1' 'g2' %}">
				<td class="td_left"><span class="first style1">{{ m.url }}</span></td>
				<td class="td_mid"><a href="/monitor/detail?id={{ m.id }}">{{ m.name }}</a></td>
				<td>{{ m.status }}</td>
				<td>{{ m.tpl }}</td>
				<td>{{ m.freq }}</td>
				<td>{{ m.group }}</td>
				<td>{{ m.stra }}</td>
				<td>100%</td>
				<td>
					{% ifequal m.open 'T' %}
	                	<a href="/monitor/status?id={{ m.id }}&do=stop" >暂停</a>|
	                {% endifequal  %}
	                {% ifequal m.open 'F' %}
	                	<a href="/monitor/status?id={{ m.id }}&do=start" >开始</a>|
	                {% endifequal  %}
					<a href="/monitor/edit?id={{ m.id }}">修改</a>|
					<a href="/monitor/delete?id={{ m.id }}" onclick="if(confirm('确定删除本组么？')){}else{return false;}";>删除</a>
				</td>
    		</tr>
    		{% endfor %}
		</table>
		<div class="page_w">
			<div class="page_font">总共{{count}}条记录</div>
			<div class="page_r">
			    <ul>
				    <li>
					    <select class="frist" onchange="javascript:window.location.href=this.options[this.selectedIndex].value;">
					    {% for p in page_list %}
					    	<option value="/monitor?page={{p}}">第{{p}}页</option>
					    {% endfor %}
					    </select>
				    </li>
				    <li>每页{{num}}条,共{{page_num}}页</li>  
				    <li><a href="/monitor?page={{page_num}}" class="page_btn" onMouseDown="this.className='page_btn_d'"><span><ins>末页</ins><img src="/static/img/new/page_ico4.gif" /></span></a></li>
				    <li><a href="/monitor?page={{page_down}}" class="page_btn" onMouseDown="this.className='page_btn_d'"><span><ins>下一页</ins><img src="/static/img/new/page_ico3.gif"/></span></a></li>
				    <li><a href="/monitor?page={{page_up}}" class="page_btn" onMouseDown="this.className='page_btn_d'"><span><img src="/static/img/new/page_ico2.gif"/><ins>上一页</ins></span></a></li>
				    <li><a href="/monitor" class="page_btn" onMouseDown="this.className='page_btn_d'"><span><img src="/static/img/new/page_ico1.gif"/><ins>首页</ins></span></a></li>
			    </ul>
			</div>
		</div>
	</div>
</div>
{% endblock %}

</body>
</html>
